home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
turble.arc
/
TURBLE.REF
< prev
next >
Wrap
Text File
|
1986-03-31
|
9KB
|
241 lines
Constants You Can Use in Turble Graphics
Colors
Name Value Comment
---- ----- -------
None 99 Turble
On 1
Off 0
Black 0 Turbo
Blue 1
Green 2
Cyan 3
Red 4
Magenta 5
Brown 6
LightGray 7
DarkGray 8
LightBlue 9
LightGreen 10
LightCyan 11
LightRed 12
LightMagenta 13
Yellow 14
White 15
Modes
BW40 0 Turbo
C40 1
BW80 2
C80 3
MR 4 Turble
CMR 5
MRC 5
HR 6
Intersect Operators (for Get)
A 1 (AND)
O 2 (OR)
X 3 (XOR)
N 4 (NOT)
E 5 (EQUAL)
B 6 (BLANK)
Miscellaneous
Circumference 360
HalfCircumference 180
Constants Used by Turble Graphics
(You can use them but you probably won't want to.)
Name Value
---- -----
ScrunchUp User-defined (Use variable Scrunch instead)
HiXMax 640 (Use functions XMax and YMax instead)
HiYMax User-defined
SegEven $b800
SegOdd $ba00
LineBytes $50
Functions You Can Use in Turble Graphics
Name and Type Description
------------- -----------
XMax : Integer; Maximum values for X and Y
YMax : Integer;
ColorDot(X,Y) : Byte; Color of specified dot
Global Variables Available in Turble Graphics
Name and Type Description
------------- -----------
ColorOfPen : Integer Color of pen...
ColorOfBack : Integer ...background...
PaletteColors : Integer ...and palette.
PenDown : Boolean Flags for pen active...
ColorIsOn : Boolean ...color on...
ResolutionHigh : Boolean ...and high resolution
TurtleAngle : Integer Angle in which turtle points
StartX : Integer Starting points for X and Y
StartY : Integer (updated constantly)
CenterX : Integer Center points for X and Y
CenterY : Integer (always the same)
Scrunch : Real Number for adjusting height
Procedures Available in Turble Graphics
Name and Type Description
------------- -----------
PenColor(Color : Integer) Sets the color...
BackColor(Color : Integer) ...background...
Palettor(Number : Integer) ...or pallete.
InitTurtle Sets or resets all defaults.
Mode(Setting : Integer) Sets the mode and calls InitTurtle.
Dot(X,Y : Integer) Draws an adjusted dot of PenColor.
Line(X1,Y1,X2,Y2 : Integer) Draws an adjusted line of PenColor.
Turn(Angle : Integer) Turns the angle (relative).
TurnTo(Angle : Integer) Turns the angle (absolute).
Go(Distance : Integer) Moves distance at default angle,
drawing as it goes.
MoveTo(X,Y : Integer) Moves to absolute position,
drawing as it goes.
Poly(Number,Sides : Integer) Draws polygon.
Tree(Height : Real) Draws tree.
Spiral(Side,Angle,Increment : Integer) Draws spiral.
InSpiral(Side,Angle,Increment : Integer) Draws inverted spiral.
SnowFlake(Size,Level : Real) Draws snowflake.
LCircle(Radius : Integer) Draws a left circle using Turble.
RCircle(Radius : Integer) Draws a right circle using Turble.
CCircle(Radius : Integer) Draws a centered circle using Turble.
Circle(Radius : Integer) Draws a circle by plotting each point.
Slinky(Size,Bend : Integer) Draws a series of circles.
Paint(X,Y,Border,Color : Integer)
Paints a figure. X,Y are the
starting points. Border is the
color of the border and color is
the color of the paint.
Tips on Using Get and Put Procedures
Here is the syntax for the get and put procedures:
Get(StartWidth,StartHeight,Width,Height : Integer;
var AName : Storage;
FName : Strng;
Gets a figure from the screen and
puts it in memory and, optionally,
onto the screen.
Put(var AName : Storage; StartWidth, StartHeight : Integer;
Operator : Byte;
FName : Strng)
Puts a figure from the memory or a
file onto the screen.
The Get and Put procedures use the following global type
declaration.
Type
Strng = String[14];
Storage = Record
Pixels : Array[1..MaxArray] of Byte;
StoreHeight : Integer;
StoreWidth : Integer;
end;
They also use the constant:
Const
MaxArray = 3000;
You can increase MaxArray for large figures or decrease it for
small ones. The array must be at least the size of the Height
times the Width divided by eight for high resolution or four for
medium resolution.
Before using GET, you must declare a variable of type Storage that
you will use to name the figure you want to move. Later you will
use the same name to Put the figure. For example:
Var
Box : Storage;
Get(1,1,50,50,Box,'');
Put(Box,150,150,e,'');
This gets a square 50 by 50 starting at 1,1. It stores the figure
in Box. Then Put takes the figure out of Box and puts it onto the
screen at 150,150. The operator "e" indicates that the new figure
overwrites anything that was there before. The empty set indicates
that the whole process takes place in memory.
If you wanted Box to be saved in a file, you could do it like this:
Var
Box : Storage;
Get(1,1,50,50,Box,'BOX.FIG');
Then you could get the figure from the file even after booting (or
from another program) with this command:
Var
Box : Storage;
Put(Box,150,150,e,'BOX.FIG');
The syntax may be confusing. Get gets the figure from the screen
and places it in memory and, optionally, in a file. Put takes the
figure out of memory or a file and puts it on the screen. When
using a file, you only have to Get or Put from the file once.
After the first time the figure is in memory ready for use.
You can declare several different figures and move them all in
different combinations.
Var
Box : Storage;
Circle : Storage;
Get(1,1,50,50,Box,'');
Get(1,1,50,150,Circle,'');
Put(Circle,150,150,x,'');
Put(Box,150,150,x,'');